package cn.itcast.bos.action;

import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import cn.itcast.bos.domain.Role;

@Controller
@Scope("prototype")
public class RoleAction extends BaseAction<Role> {

	private String functionIds;
	public void setFunctionIds(String functionIds) {
		this.functionIds = functionIds;
	}
	//添加角色
	public String save(){
		roleService.save(model,functionIds);
		return NONE;
	}
	
	//角色信息列表
	public String list(){
		List<Role> list = roleService.findAll();
		this.writeListToJson(list, new String[]{"functions","users"});
		return NONE;
	}
}
